#!/bin/bash
#创建所需目录
base_dir=/cnswhy/api/jar
version=1.0.0
mkdir -p $base_dir
path=`pwd`
maven_dir=$path
source /etc/profile

#build the jar
git pull
cd $maven_dir/cnswhy-cloud
mvn clean install -DskipTests -P test

##将jar copy至相应目录
#cp $maven_dir/cnswhy-auth/target/cnswhy-auth-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-gateway/target/cnswhy-gateway-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-monitor/cnswhy-monitor-admin/target/cnswhy-monitor-admin-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-server/cnswhy-server-base/target/cnswhy-server-base-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-server/cnswhy-server-system/target/cnswhy-server-system-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-server/cnswhy-server-app/target/cnswhy-server-app-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-server/cnswhy-server-merchant/target/cnswhy-server-merchant-1.0.0.jar $base_dir/
#cp $maven_dir/cnswhy-server/cnswhy-server-consumer/target/cnswhy-server-consumer-1.0.0.jar $base_dir/
scp $maven_dir/cnswhy-auth/target/cnswhy-auth-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-gateway/target/cnswhy-gateway-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-monitor/cnswhy-monitor-admin/target/cnswhy-monitor-admin-1.0.0.jar root@192.168.0.12:$base_dir/
#scp $maven_dir/cnswhy-server/cnswhy-server-base/target/cnswhy-server-base-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-server/cnswhy-server-system/target/cnswhy-server-system-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-server/cnswhy-server-app/target/cnswhy-server-app-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-server/cnswhy-server-merchant/target/cnswhy-server-merchant-1.0.0.jar root@192.168.0.12:$base_dir/
scp $maven_dir/cnswhy-server/cnswhy-server-consumer/target/cnswhy-server-consumer-1.0.0.jar root@192.168.0.12:$base_dir/